package SimpleFactoryMode.pizzastore.pizza;

/**
 * @program: DesignModeProject
 * @description:
 * @author: Li canzhang
 * @create: 2022-04-22 22:36
 **/
public class PizzaFactory {
    private Pizza pizza = null;

    public Pizza getPizza(String name){
        if("cheese".equals(name)){
            pizza = new CheesePizza(name);
            return pizza;
        }else if("greek".equals(name)){
            pizza =  new GreekPizza(name);
            return pizza;
        }
        return pizza;
    }
}
